<template>
	<view class="movie-template-warp">
		<block v-for="item in list" :key="item">
			<view class="movie-template-float" @click="moviesTo(item.movieId)">
				<movieTemplate :movielist="item"></movieTemplate>
			</view>	
		</block>	
	</view>
</template>

<script>
	import movieTemplate from "../movie/movie-template";
	export default {
		props:['list'],
		data(){
			return{
				lists:{}
			}
		},
		methods:{
			moviesTo(e){
				uni.navigateTo({
					url:"/pages/movies/movie-datail/movie-datail?movieId="+e
				})
			}
		},
		mounted(){
			this.$watch('list', function(newVal, oldVal){//双层data先取值再赋值
				this.lists=newVal;
				//console.log(this.list);
			});
		},
		components:{
			movieTemplate
		}
	}
</script>

<style>
	.movie-template-warp{display: inline-block;margin: 40rpx 0 0 2rpx;}
	.movie-template-float{height: 400rpx;float:left;width: 250rpx;}
</style>
